<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/28
 * Time: 22:50
 */

namespace app\api\controller\v1;


use app\api\model\Banner as BannerModel;
use app\api\validate\IDMustBePostivelnt;
use app\lib\exception\BannerMissException;

class Banner
{
    /**
     * @param $id
     */
    public function getBanner($id)
    {
        (new IDMustBePostivelnt())->goCheck();

        $banner = BannerModel::getBannerByID($id);
        if (!$banner) {

            throw new BannerMissException();
        } else {
            $c = config('setting.img_prefix');
            return $banner;
        }
    }
}